﻿using MediatR;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using SCM.API.Read.Application.Command.StockCheck;
using SCM.ErrorCode;
using SCM.Extensions.StockCheck;

namespace SCM.API.Read.Controllers.StockCheck
{
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class CheckController : ControllerBase
    {
        IMediator mediator;

        public CheckController(IMediator mediator)
        {
            this.mediator = mediator;
        }
        [HttpGet]
        public async Task<APIPaging<CheckDTO>> ShowCheck([FromQuery]GetCheckCommand request)
        {
            return await mediator.Send(request);
        }
        [HttpGet]
        public async Task<APIPaging<ProfitLossDTO>> ShowProfitLoss([FromQuery]GetProfitLossCommand request)
        {
            return await mediator.Send(request);
        }
    }
}
